<?php
	require_once('paths.inc');
	require_once(INCLUDE_PATH.'constants.inc');
	require_once('page.inc');
	require_once(DB_PATH.'db.inc');
	
	require_once('security.inc');
	require_once('utils.inc');	
	require_once('time.inc');
	
	session_start();

	check_permissions(CT_PERM_FIRME);	
	html_header("LANG_Show_firme", null, "show_firms");
	
	select_js_language();
    select_language();
    
	$db = db_connect();
	$id_client = $_SESSION['user_logat']->id_client;
	$conditie = "id_client = $id_client";
	$_SESSION['camp_order_firme'] = 'nume';	    

    $arr = get_firme($db, $id_client, 0, $_SESSION['user_logat']->firme_per_pag, '-1', "ASC", $_SESSION['user_logat'], '', -1, 'nume');	                	
	
	$linkuri = array(LANG_Home => "home.php", LANG_Firme => "");					
	titlu_pagina($linkuri);
	
    output_error_msg();
    output_notice_msg();
    
    output_extra_text(LANG_EXTRA_SHOW_FIRMS);
    
	echo '<div class="container">';
		render_filter_and_search_box_firme($id_client, $_SESSION['user_logat']->firme_per_pag);
	echo '</div>';

	echo "<div id=\"content_firme\" class=\"container\">";
		echo $arr[0];
	echo "</div>";	
?>

<script type="text/javascript">	
	document.getElementById('sterge_firma_buton').disabled = true;
	document.getElementById('print_firma_buton').disabled = true;
	document.getElementById('edit_firma_buton').disabled = true;
	document.getElementById('view_firma_buton').disabled = true;
    document.getElementById('print_firma_buton').disabled = true;
	introdu_cache_prima_data_firme(<?php echo $_SESSION['user_logat']->firme_per_pag; ?>, <?php echo $id_client; ?>, '', 'ASC', 'content_firme');
</script>

<?php html_footer(); ?>